package net.oschina.archx.spring.mongo.document;

import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;

/**
 * 订阅者 粉丝关系模型
 *
 * @author Archx[archx@foxmail.com]
 * @date 2016/3/22 0022
 */
@Document
public class Subscriber implements Serializable {
    private static final long serialVersionUID = -7532326532280128690L;

    @Id
    private ObjectId id;

    private String openid; // 微信用户标识

    private String nickName; // 微信用户昵称

    // throw org.springframework.data.mongodb.core.index.MongoPersistentEntityIndexResolver$CyclicPropertyReferenceException: Found cycle for field
    private Subscriber superior; // 上级

    public ObjectId getId() {
        return id;
    }

    public void setId(ObjectId id) {
        this.id = id;
    }

    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public Subscriber getSuperior() {
        return superior;
    }

    public void setSuperior(Subscriber superior) {
        this.superior = superior;
    }
}
